package net.moonbiter.ebs.protocols.httpparams.tree.interp.types;

import net.moonbiter.OperationFailureException;
import net.moonbiter.ebs.NodeName;
import net.moonbiter.ebs.protocols.httpparams.tree.Tree;
import net.moonbiter.ebs.validation.ValidationException;

public class StringArrayInterpreter extends TreeTypeInterpreterBase implements TreeTypeInterpreter<String[]> {

	public String[] interpret(Tree tree, NodeName[] namePortions)
			throws ValidationException, OperationFailureException {
		// se esiste dev'essere del tipo giusto
		if (tree.hasNode(namePortions)){
			return requireStringLeafExistence(tree, namePortions);
		} else {
			return new String[]{};
		}
	}
	
	public boolean isComposed() {
		return false;
	}	
}
